//
//  YBNetworking.h
//  YanzhouCloud
//
//  Created by Cocoa on 2019/7/2.
//  Copyright © 2019 yibai. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ReactiveObjC.h>
@protocol YBNetworkingDelegate;

extern NSString * _Nonnull const Rest_MultiMediaBlock;


@interface YBNetworking : NSObject

- (instancetype _Nullable )initWithBaseURL:(NSURL * _Nullable)baseURL;
- (instancetype _Nullable )initWithBaseURL:(NSURL * _Nullable)baseURL configuration:(NSURLSessionConfiguration *_Nullable)configuration;

@property (nonatomic, strong) id<YBNetworkingDelegate> _Nullable delegate;
@property (nonatomic, strong, readonly) NSDictionary * _Nonnull HTTPHeaderFields;

- (RACSignal *_Nonnull)sendRequest:(NSDictionary *_Nonnull)reqInfo;
- (RACSignal *_Nonnull)download:(NSURL *_Nonnull)url destination:(NSURL *_Nullable)fileURL;
- (void)setValue:(id _Nonnull )value forHTTPHeaderField:(nonnull NSString *)field ;
- (void)removeValueForHTTPHeaderField:(nonnull NSString *)field;

@property (nonatomic, strong, readonly) RACSignal *_Nullable(^ _Nullable call)(NSString * _Nullable method, NSString * _Nullable path, NSDictionary * _Nullable param);
@property (nonatomic, strong, readonly) RACSignal *_Nullable(^ _Nullable download)(NSString * _Nonnull method, NSString * _Nullable path, NSDictionary * _Nullable param);

@end

@protocol YBNetworkingDelegate <NSObject>

@optional
- (void)ybNetworking:(YBNetworking *_Nonnull)request didReceiveDatas:(NSDictionary *_Nullable)dataDic;

@end

